package com.hh.bss.common.tree;

import java.util.ArrayList;
import java.util.List;

public class TreeNode {
	private String id;	
    private String parentId="0";
    private String text;
    public String getParentId() {
		return parentId;
	}
	public void setParentId(String parentId) {
		this.parentId = parentId;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	private boolean isLeaf=false;
    public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public boolean isLeaf() {
		return isLeaf;
	}
	public void setLeaf(boolean isLeaf) {
		this.isLeaf = isLeaf;
	}
	public boolean getIsLeaf() {
		return isLeaf;
	}
	public void setIsLeaf(boolean isLeaf) {
		this.isLeaf = isLeaf;
	}
	public List getChildren() {
		return children;
	}
	public void setChildren(List children) {
		this.children = children;
	}
	private List children=null;
    public void addChildren(TreeNode treeNode){
    	if (children==null) children=new ArrayList();
    	TreeNode one=null;
    	for(int i=0;i<children.size();i++){
    		one=(TreeNode)children.get(i);
    		if (treeNode.getId().equals(one.getId())) return;
    	}
    	children.add(treeNode);
    }
}
